﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Page/Site.Master" AutoEventWireup="true" CodeBehind="liquidation-asset.aspx.cs" EnableEventValidation="false" Inherits="Presentation.Page.liquidation_asset" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<!---Check-all----->
<script type="text/javascript">
    function checkAll(checkId) {
        $('.bordered tbody input').each(function () {
            if ($('input#chkAll').is(":checked")) {
                $(this).attr({ 'checked': 'checked' });
                $(this).parent().parent().css({ 'background': 'rgb(208, 233, 198)' });
            } else {
                $(this).attr({ 'checked': false });
                $(this).parent().parent().css({ 'background': '#ffffff' });
            }
        })
    }
</script>
<!-------End------->

<!------Popup------>
<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#liquidationasset').dialog({
            autoOpen: false,
            draggable: true,
            height: "auto",
            width: "auto",
            position: ['center', 50],
            resizable: false,
            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function (type, data) {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#duyetpurchasequoteheader').dialog({
            autoOpen: false,
            draggable: true,
            height: "auto",
            width: "auto",
            position: ['center', 50],
            resizable: false,
            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function (type, data) {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#exporttoexcel').dialog({
            autoOpen: false,
            draggable: true,
            height: "auto",
            width: "auto",
            position: ['center', 50],
            resizable: false,
            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function (type, data) {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#thongbao').dialog({
            autoOpen: false,
            draggable: true,
            height: "auto",
            width: "372px",
            position: ['center', 50],
            resizable: false,

            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function (type, data) {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#thongbaoxoa').dialog({
            autoOpen: false,
            draggable: true,
            height: "auto",
            width: "372px",
            position: ['center', 50],
            resizable: false,

            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function (type, data) {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>
<!-------End------->

<!---AutoComplete-->
<script type="text/javascript">
    function pageLoad(sender, args) {
        $(document).ready((function () {
            var availableTags1 = [ <%= SuggestionList %>];

            $("#<%= txtSearch.ClientID %>").autocomplete({
                source: availableTags1
            });
        }));

        $(function () {
            $(".textboxngaynhap").datepicker({
                showOn: "button",
                buttonImage: "../images/calendar.gif",
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true,
                buttonImageOnly: true
            }).val();
        });


        $(function () {
            $(".textboxfillter").datepicker({
                showOn: "button",
                buttonImage: "../images/calendar.gif",
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true,
                buttonImageOnly: true
            }).val();
        });

        $(function ($) {
            $(".textboxngaynhap").mask("99/99/9999"); //Kiem tra ngay nhap
            $(".textboxfillter").mask("99/99/9999"); //Kiem tra ngay nhap
            $("#phone").mask("(999) 999-9999");//Kiem tra so dien thoai
            $("#tin").mask("99-9999999");
            $("#ssn").mask("999-99-9999");
        });

        //Check Row Hender Color
        $(document).ready(function () {
            $('.adminlist1 tr').click(function (event) {
                if (event.target.type !== 'checkbox') {
                    $(':checkbox', this).trigger('click');
                }
            });

            $("input[type='checkbox']").change(function (e) {
                if ($(this).is(":checked")) {
                    $(this).closest('tr').css("background", "Wheat");
                } else {
                    $(this).closest('tr').css("background", "");
                }
            });
        });
    }
</script>
<!-------End------->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:UpdatePanel ID="upDateToolBar" runat="server">
    <ContentTemplate>
        <div id="toolbar-1" class="yui3-toolbar">
            <div class="div-search-texbox">
                <asp:TextBox ID="txtSearch" placeholder="Nhập vào từ khoá tìm kiếm..." CssClass="textbox_child_Search" runat="server"></asp:TextBox>      
            </div>

            <div class="div-search">
                <asp:Button ID="cmdSerach" ToolTip="Tìm kiếm" runat="server" CssClass="btn-add-search" Text="" OnClick="cmdSerach_Click" />
                <asp:Button ID="cmdRefesh" ToolTip="Làm tươi" runat="server" CssClass="btn-add-refesh"  Text="" onclick="cmdRefesh_Click" />
           

                <asp:Button ID="cmdDuyet" ToolTip="Duyệt" runat="server" CssClass="btn-add-review"  Text="" OnClick="cmdDuyet_Click" />
                <asp:Button ID="cmdExport" Visible="false" runat="server" CssClass="btn-add-excel"  Text=""  OnClick="cmdExport_Click" />
                <input type="button" title="Xuất ra tập tin Excel" onclick="tableToExcel('testTable', 'W3C Example Table')" class="btn-add-excel" />
            </div>
        <div class="clr"></div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

<asp:UpdatePanel ID="upDatePanelAll" runat="server">
    <ContentTemplate>
         <%=StrAlert%>
        <!-----------Hiễn-Thị-Dữ-Liệu------------>
        <table  class="bordered">
            <thead>
                 <tr>
                    <th style="width:5%">STT</th>        
                    <th style="width:5%">
                        <input type="checkbox" onclick="checkAll('chkList');" id="chkAll">
                    </th>
                    <th style="width:10%">Tên tài sản</th>
                    <th style="width:10%">Tổng nguồn</th>
                    <th style="width:10%">Giá trị khấu hao</th>
                    <th style="width:10%">Giá trị còn lại</th>
                    <th style="width:10%">Giá trị thanh lý</th>
                    <th style="width:10%">Tình trạng</th>
                    <th style="width:10%">Nguyên nhân</th>
                 </tr>
            </thead>

            <tbody>
                <asp:ListView ID="ListViewAll" runat="server" ItemPlaceholderID="lstViewAll" DataKeyNames="STT" OnItemCommand="ListViewAll_ItemCommand" OnItemDataBound="ListViewAll_ItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td style="text-align:center">
                                <asp:Label ID="lb_lst_ID" runat="server" Text='<%# Eval("STT") %>'></asp:Label>
                            </td>

                            <td style="text-align:center">
                                <asp:CheckBox ID="chkList" onclick='highlight(this)' ClientIDMode="Static" runat="server" />
                            </td>

                            <td style="text-align:center">
                                <asp:LinkButton ID="linkListName_C" CommandName="Accept_C" runat="server" Text='<%# Eval("Tên tài sản")%>'></asp:LinkButton>
                                <input type="hidden" id="hiddenId" value='<%# Eval("STT") %>' runat="server" name="hiddenId" />
                            </td>

                            <td style="text-align:center">
                                <asp:LinkButton ID="linkListName" CommandName="Accept" runat="server" Text='<%# Eval("Tổng nguồn","{0:0,00}")%>'></asp:LinkButton>
                            </td>

                            <td style="text-align:center">
                                <asp:LinkButton ID="linkListName_A" CommandName="Accept_A" runat="server" Text='<%# Eval("Giá trị khấu hao","{0:0,00}")%>'></asp:LinkButton>
                            </td>

                            <td style="text-align:center">
                                <asp:LinkButton ID="linkListName_D" CommandName="Accept_D" runat="server" Text='<%# Eval("Giá trị còn lại","{0:0,00}")%>'></asp:LinkButton>
                            </td>

                            <td style="text-align:center">
                                <asp:LinkButton ID="linkListName_E" CommandName="Accept_E" runat="server" Text='<%# Eval("Giá trị thanh lý","{0:0,00}")%>'></asp:LinkButton>
                            </td>

                            <td style="text-align:center">
                                <asp:LinkButton ID="linkListName_B" CommandName="Accept_B" runat="server" Text='<%# Eval("Tình trạng","{0:0,00}")%>'></asp:LinkButton>
                            </td>

                            <td>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("Nguyên nhân") %>'></asp:Label>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <asp:PlaceHolder runat="server" ID="lstViewAll"></asp:PlaceHolder>
                    </LayoutTemplate>
                </asp:ListView>
            </tbody>
        </table>
        <!--------------Kêt-thúc----------------->

        <!-------------Phân-trang---------------->
        <table  class="bordered">
            <thead>
                <tr>
                    <th class="pager">
                        <asp:DataPager ID="DataPagerListAll" runat="server" 
                            OnPreRender="DataPagerListAll_PreRender" PagedControlID="ListViewAll">
                            <Fields>
                                <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;" 
                                    ShowFirstPageButton="True" ShowNextPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;" 
                                    ShowLastPageButton="True" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </th>
                </tr>
            </thead>
        </table>
        <!--------------Kêt-thúc----------------->
    </ContentTemplate>
</asp:UpdatePanel>

<!-------------Exprot-Excel-------------->
<asp:UpdatePanel ID="upDatePanelExport" runat="server">
<ContentTemplate>
    <table  class="bordered" id="testTable" style="display:none">
        <thead>
            <tr>
                <th style="width:5%">STT</th>        
                <th style="width:10%">Tên tài sản</th>
                <th style="width:10%">Tổng nguồn</th>
                <th style="width:10%">Giá trị khấu hao</th>
                <th style="width:10%">Giá trị còn lại</th>
                <th style="width:10%">Giá trị thanh lý</th>
                <th style="width:10%">Tình trạng</th>
                <th style="width:10%">Nguyên nhân</th>
            </tr>
        </thead>

        <tbody>
            <asp:ListView ID="ListViewExport" runat="server" ItemPlaceholderID="lstViewExport" OnItemDataBound="ListViewExport_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td style="text-align:center">
                            <asp:Label ID="lbSTT" runat="server" Text='<%# Eval("STT") %>'></asp:Label>
                        </td>

                        <td style="text-align:center">
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("Tên tài sản") %>'></asp:Label>
                        </td>

                        <td style="text-align:right">
                            <asp:Label ID="lbLoaiTaiLieu" runat="server" Text='<%# Eval("Tổng nguồn","{0:0,00}") %>'></asp:Label>
                        </td>

                        <td style="text-align:left">
                            <asp:Label ID="Label4" runat="server" Text='<%# Eval("Giá trị khấu hao","{0:0,00}") %>'></asp:Label>
                        </td>

                        <td style="text-align:center">
                            <asp:Label ID="Label9" runat="server" Text='<%# Eval("Giá trị còn lại","{0:0,00}") %>'></asp:Label>
                        </td>

                        <td style="text-align:center">
                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("Giá trị thanh lý","{0:0,00}") %>'></asp:Label>
                        </td>

                        <td style="text-align:center">
                            <asp:Label ID="Label5" runat="server" Text='<%# Eval("Tình trạng","{0:0,00}") %>'></asp:Label>
                        </td>

                        <td style="text-align:left">
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("Nguyên nhân") %>'></asp:Label>
                        </td>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <asp:PlaceHolder runat="server" ID="lstViewExport"></asp:PlaceHolder>
                </LayoutTemplate>
            </asp:ListView>
        </tbody>
    </table>
</ContentTemplate>
</asp:UpdatePanel>
<!--------------Kêt-thúc----------------->

<!-------------Edit-Dữ-Liệu-------------->
<div id="liquidationasset" title="Xét duyệt thanh lý tài sản">
    <asp:UpdatePanel ID="upNewUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <div class="toolbar-ui-all-big">
                <asp:Button ID="imgSave" ToolTip="Duyệt" runat="server" CssClass="btn-add-review"  Text="" OnClick="imgSave_Click" />
                <asp:Button ID="imgrefesh" ToolTip="Làm tươi" runat="server" CssClass="btn-add-refesh"  Text="" onclick="imgrefesh_Click" />
            </div>

            <div class="clr"></div>
            <div class="ui-main">
                <div style="display: none"><asp:Label ID="lbID" runat="server"></asp:Label></div>
                <div class="ui-box-text-box">
                    <label class="label">
                        Tên tài sản </label>
                    <asp:TextBox ID="txtTenTaiSan" CssClass="textbox" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">
                        Tổng nguồn </label>
                    <asp:TextBox ID="txtTongNguon" CssClass="textbox" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">
                        Giá trị khấu hao </label>
                    <asp:TextBox ID="txtGiaTriKhauHao" CssClass="textbox" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">
                        Giá trị còn lại </label>
                    <asp:TextBox ID="txtGiaTriConLai" CssClass="textbox" runat="server"></asp:TextBox>
                </div>

                <div class="clr"></div>

                <div class="ui-box-text-box">
                    <label class="label">
                        Giá trị thanh lý </label>
                    <asp:TextBox ID="txtGiaTriThanhLy" CssClass="textbox" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">
                        Tình trạng</label>
                    <asp:TextBox ID="txtTinhTrang" CssClass="textbox" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">
                        Nguyên nhân </label>
                    <asp:TextBox ID="txtNguyenNhan" TextMode="MultiLine" CssClass="textbox-muiti" runat="server"></asp:TextBox>
                </div>

                <div class="clr"></div>
            </div>
            <div class="clr"></div>
            <asp:UpdateProgress ID="UpdateProgress1" runat="server"  AssociatedUpdatePanelID="upNewUpdatePanel">
                <ProgressTemplate>
                    <img alt='loadding' class="loading" src="../images/loading-fb.gif" /><br />
                    <div class="loading-label-right">
                        Đang xử lý dữ liệu...
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="imgSave" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</div>
<!--------------Kêt-thúc----------------->

<!-------------Thông-Bao-Xoá------------->
<div id="thongbaoxoa" title="Thông Báo">
    <asp:UpdatePanel ID="upDatePanelThongBaoXoa" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <div style="display:none">
                <asp:Label ID="lbIDXoa" runat="server" Text=""></asp:Label>
                <asp:Label ID="lbTrangThaiDuyet" runat="server" Text=""></asp:Label>
            </div>
            <p>
                <span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>
                <asp:Label ID="lbThongBaoXoa" CssClass="error-msg" runat="server" Text=""></asp:Label>
            </p>
            <hr />
            <div class="toolbar-ui-footer">
                <asp:Button ID="cmdAgree" CssClass="btn btn-info" Height="29px" runat="server" 
                    Text="Đồng ý" onclick="cmdAgree_Click" />

                <asp:Button ID="cmdClose" CssClass="btn btn-info" Height="29px" runat="server" 
                    Text="Bỏ qua" onclick="cmdClose_Click" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
<!--------------Kêt-thúc----------------->

<!-------------Thông-Bao----------------->
<div id="thongbao" title="Thông Báo">
    <asp:UpdatePanel ID="updatePanelThongBao" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <p>
                <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
                <asp:Label ID="lbThongBaoLoi" CssClass="error-msg" runat="server" Text=""></asp:Label>
            </p>
            <hr />
            <div class="toolbar-ui-footer">
                <asp:Button ID="cmdCloseThongBao" CssClass="btn btn-info" Height="29px" runat="server" 
                    Text="Đóng lại" onclick="cmdCloseThongBao_Click" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
<!--------------Kêt-thúc----------------->
</asp:Content>
